package com.dhnsoft.map;

import com.dhnsoft.util.Constant;

import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @Description
 * @ClassName TankHouse
 * @Author dhn
 * @date 2020.11.20 21:18
 */
//大本营
public class TankHouse {
    //老巢的xy坐标
    public static final int HOUSE_X = (Constant.FRAME_WIDTH-3*MapTile.tileW>>1)+2;
    public static final int HOUSE_Y = Constant.FRAME_HEIGHT-3*MapTile.tileW+32;
    private List<MapTile> tiles=new ArrayList<>();
    public TankHouse(){
        tiles.add(new MapTile(HOUSE_X,HOUSE_Y));
        tiles.add(new MapTile(HOUSE_X,HOUSE_Y+MapTile.tileW));
        tiles.add(new MapTile(HOUSE_X+MapTile.tileW,HOUSE_Y));
        tiles.add(new MapTile(HOUSE_X+ MapTile.tileW*2,HOUSE_Y));
        tiles.add(new MapTile(HOUSE_X+ MapTile.tileW*2,HOUSE_Y+ MapTile.tileW));
        //有蚊子的块
        tiles.add(new MapTile(HOUSE_X+ MapTile.tileW,HOUSE_Y+ MapTile.tileW));
        //设置老巢地图块
        tiles.get(tiles.size()-1).setType(MapTile.TYPE_HOUSE);
    }

    public void draw(Graphics g){
        for (MapTile tile : tiles) {
            tile.draw(g);
        }
    }

    public List<MapTile> getTiles() {
        return tiles;
    }
}
